/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.tnmk.worktime.service.dao.entry;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.joda.time.DateTime;
import org.tnmk.worktime.service.SessionService;
import org.tnmk.worktime.service.model.xmladapter.DateTimeXmlAdapter;
import org.tnmk.worktime.service.model.xmladapter.ListWrapper;

/**
 *
 * @author tnmkhoi
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "workSession")
public class SessionEntry extends BaseEntry {
  
//  private Integer id = null;//not set value yet
  @XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
  private DateTime inTime;
  @XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
  private DateTime outTime;
  @XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
  private DateTime expectedOutTime;
  @XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
  private DateTime breakBeginTime;
  @XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
  private DateTime breakEndTime;// = new DateTime(1,1,1,13,30);
  private float expectWorkHoursToday = SessionService.WORK_HOURS_IN_DAY;//total hours should work today to satisfy 40 hours/week (not calculate leave days here)
  private float mustWorkHoursToday = expectWorkHoursToday;//total hours actually must work today to satisfy 40 hours/week (after minus leave hours)
  private float workedHours = 0;//(hour unit)
  private int leaveHours = 0;//hour of leaving (sick leave, annual leave...)
  private String note;
  private SessionType type = SessionType.Work;//Default is Work
  private ListWrapper<SpendEntry> moneySpend = new ListWrapper<>();
  
  public SessionEntry() {
    super();
  }


  /**
   * @return the inTime
   */
  public DateTime getInTime() {
    return inTime;
  }

  /**
   * @param inTime the inTime to set
   */
  public void setInTime(DateTime inTime) {
    this.inTime = inTime;
  }

  /**
   * @return the expectOutTime
   */
  public DateTime getExpectedOutTime() {
    return expectedOutTime;
  }

  /**
   * @param outTime the expectOutTime to set
   */
  public void setExpectedOutTime(DateTime outTime) {
    this.expectedOutTime = outTime;
  }

  /**
   * @return the outTime
   */
  public DateTime getOutTime() {
    return outTime;
  }

  /**
   * @param outTime the outTime to set
   */
  public void setOutTime(DateTime outTime) {
    this.outTime = outTime;
  }

  /**
   * @return the breakBeginTime
   */
  public DateTime getBreakBeginTime() {
    return breakBeginTime;
  }

  /**
   * @param breakBeginTime the breakBeginTime to set
   */
  public void setBreakBeginTime(DateTime breakBeginTime) {
    this.breakBeginTime = breakBeginTime;
  }

  /**
   * @return the breakEndTime
   */
  public DateTime getBreakEndTime() {
    return breakEndTime;
  }

  /**
   * @param breakEndTime the breakEndTime to set
   */
  public void setBreakEndTime(DateTime breakEndTime) {
    this.breakEndTime = breakEndTime;
  }

  /**
   * @return the expectWorkTimeToday
   */
  public float getExpectWorkHoursToday() {
    return expectWorkHoursToday;
  }

  /**
   * @param expectWorkTimeToday the expectWorkTimeToday to set
   */
  public void setExpectWorkHoursToday(float expectWorkHoursToday) {
    this.expectWorkHoursToday = expectWorkHoursToday;
  }

  /**
   * @return the currentWorkHours
   */
  public float getWorkedHours() {
    return workedHours;
  }

  /**
   * @param workHours the currentWorkHours to set
   */
  public void setWorkedHours(float workedHours) {
    this.workedHours = workedHours;
  }

  /**
   * @return the leaveHours
   */
  public int getLeaveHours() {
    return leaveHours;
  }

  /**
   * @param leaveHours the leaveHours to set
   */
  public void setLeaveHours(int leaveHours) {
    this.leaveHours = leaveHours;
  }

  /**
   * @return the mustWorkHoursToday
   */
  public float getMustWorkHoursToday() {
    return mustWorkHoursToday;
  }

  /**
   * @param mustWorkHoursToday the mustWorkHoursToday to set
   */
  public void setMustWorkHoursToday(float mustWorkHoursToday) {
    this.mustWorkHoursToday = mustWorkHoursToday;
  }

  /**
   * @return the note
   */
  public String getNote() {
    return note;
  }

  /**
   * @param note the note to set
   */
  public void setNote(String note) {
    this.note = note;
  }

  public ListWrapper<SpendEntry> getMoneySpend() {
    return moneySpend;
  }

  public void setMoneySpend(ListWrapper<SpendEntry> moneySpend) {
    this.moneySpend = moneySpend;
  }

  public SessionType getType() {
    return type;
  }

  public void setType(SessionType type) {
    this.type = type;
  }

}
